<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><{$_config.cmsName}> <{$_config.version}></title>
		<{$showjs}>
		<link rel="stylesheet" type="text/css" href="css/main.css"/>
		<script type="text/javascript">
			Ext.BLANK_IMAGE_URL = 'img/s.gif';
			</script>
		</head>
		<body >
			<div id="loading-mask" style=""></div>
			<div id="loading">
				<div class="loading-indicator"><img src="img/extanim32.gif" width="32" height="32" style="margin-right:8px;" align="absmiddle"/>
					<a href="index.html">刷新</a> -
					<span id="loading-yfo"><a href="/" target="_blank"><{$_config.cmsName}> <{$_config.version}></a></span><br />
					<span id="loading-msg">加载样式表和图片...</span>
				</div>
			</div>
			<script language="javascript">
				//设置树的点击事件
				function treeClick(node,e) {
					if(node.isLeaf()){
						e.stopEvent();
						//alert(node.id);
						//alert(node.id);//此处显示正常
						var n = tab.getComponent(node.id);
						if (!n) {
							var n = tab.add({
								'id' : node.id,
								'title' : node.text,
								closable:true,
								//html:node.attributes.action
								//autoLoad:node.attributes.action
								html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="'+node.attributes.action+'"></iframe>'
								//autoLoad:{url:node.attributes.action, scripts:true}
							});
						}
						tab.setActiveTab(n);
					}
				}

				//生成标签页
				var tab = new Ext.TabPanel({
					region:'center',
					defaults:{autoScroll: true},
					//defaults:{autoHeight: true},
					deferredRender:false,
					activeTab:0,
					resizeTabs:true, // turn on tab resizing
					inTabWidth: 115,
					tabWidth:135,
					enableDD:true,
					enableTabScroll:true

				});

				Ext.onReady(function(){
					//layout
					var viewport = new Ext.Viewport({
						layout:'border',
						items:[
						new Ext.BoxComponent({
							split:true,
							region:'north',
							el: 'north',
							height:60,
							collapsible :true,
							layoutConfig:{
								animate:true
							}

							}),new Ext.BoxComponent({
							region:'south',
							el: 'south',
							height:25
							}),{
							region:'west',
							id:'west-panel',
							split:true,
							width: 200,
							minSize: 175,
							maxSize: 400,
							margins:'0 0 0 0',
							layout:'accordion',
							title:'系统菜单',
							collapsible :true,
							layoutConfig:{
								animate:true
							},
							items: [
							<{$yi}>]
						},
						tab,{
							region:'east',
							id:'east-panel',
							split:true,
							width: 200,
							minSize: 175,
							maxSize: 400,
							margins:'0 0 0 0',
							//hidden :true,
							layout:'accordion',
							title:'属性配制',
							collapsible :true,
							collapsed: true,
							layoutConfig:{
								animate:true
							}
						}
						]
					});

					//设置综合信息管理
					var Tree = Ext.tree;
					// set the root node
					var root = new Tree.AsyncTreeNode({
						text: 'isrn@qq.com',
						draggable:false,
						id:'root'
					});

					var tree = new Tree.TreePanel({
						el:'tree-div',
						autoScroll:true,
						root:root,
						animate:true,
						enableDD:true,
						border:false,
						rootVisible:false,
						containerScroll: true,
						loader: new Tree.TreeLoader({
							dataUrl:'treedata.php?node=root'
						})
					});
				new Ext.tree.TreeSorter(tree, {
					folderSort: true,
					dir: "desc",
					sortType: function(node) {
						// sort by a custom, typed attribute:
						//return parseInt(node.id, 10);
					}
				});
					tree.setRootNode(root);
					// render the tree
					tree.render();
					root.expand();
					tree.on('click',treeClick);

					//tree2
					//设置日常办公
					var Tree = Ext.tree;
					// set the root node
					var root2 = new Tree.AsyncTreeNode({
						text: 'isrn@qq.com',
						draggable:false,
						id:'root2'
					});

					var tree = new Tree.TreePanel({
						el:'tree',
						autoScroll:true,
						root:root2,
						animate:true,
						enableDD:true,
						border:false,
						height:10000,
						rootVisible:false,
						containerScroll: true,
						loader: new Tree.TreeLoader({
							dataUrl:'treedata.php?node=root2'
						})
					});

					tree.setRootNode(root2);
					// render the tree
					tree.render();
					root.expand();
					tree.on('click',treeClick);

					//设置系统菜单
					var Tree = Ext.tree;
					// set the root node
					var root3 = new Tree.AsyncTreeNode({
						text: 'isrn@qq.com',
						draggable:false,
						id:'root3'
					});

					var tree = new Tree.TreePanel({
						el:'tree3',
						autoScroll:true,
						root:root3,
						animate:true,
						enableDD:true,
						border:false,
						height:10000,
						rootVisible:false,
						containerScroll: true,
						loader: new Tree.TreeLoader({
							dataUrl:'treedata.php?node=root3'
						})
					});

					tree.setRootNode(root3);
					// render the tree
					tree.render();
					root.expand();
					tree.on('click',treeClick);



					//end loding
					setTimeout(
					function() {
						Ext.get('loading').remove();
						Ext.get('loading-mask').fadeOut({remove:true});
					}, 250
					);
				});

			</script>
			<div id="north"><div>
					<p class="api-title" style="float:left"><b><{$_config.cmsName}> <{$_config.version}></b></p></div><div style="text-align:right; float:right; margin:6px;"><a href="logout.php"><font color="#FFFFFF">退出</font></a></div>
			</div>
			<div>
				<div id="south" >
					<div style="float:right;margin:5px;font:normal 12px tahoma, arial, sans-serif, 宋体;"> Power By: <a href="/"><{$_config.cmsName}></a></div>
				</div>
			</body>

		</html>
